var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", { value: !0 });
var a = t("GameEm"),
    i = new ((function () {
        function t() {
            this.spriteData = {};
            this.foodItem = {};
            this.colorData = {};
            this.qualityCfg = {};
            this.tempColor = {};
            this.typeIconPath = {
                1: "Dynamic_Icon_CostumeType_Head",
                2: "Dynamic_Icon_CostumeType_Body",
                3: "Dynamic_Icon_CostumeType_Hand"
            };
        }
        t.prototype.setFoodSprite = function (t, e) {
            this.foodItem[e] && this.setTaskSprite(t, this.foodItem[e].icon);
        };
        t.prototype.setIdSpriteData = function (t, e, o, a) {
            this.spriteData = t;
            this.foodItem = e;
            this.colorData = o;
            this.qualityCfg = a;
        };
        t.prototype.getTypeColor = function (t) {
            var e = this.colorData[t];
            if (e) {
                var o = e.value1;
                this.tempColor[o] || (this.tempColor[o] = new cc.Color().fromHEX("" + o));
                return this.tempColor[o];
            }
            return cc.Color.WHITE;
        };
        t.prototype.setRewardCoin = function (t, e) {
            switch (t) {
                case a.RewardResKind.jinBi:
                    this.setSpritePath(e, "Dynamic_Icon_Goods_GameMoney");
                    break;
                case a.RewardResKind.zhuanShi:
                    this.setSpritePath(e, "Dynamic_Icon_Goods_Gem");
            }
        };
        t.prototype.setTaskSprite = function (t, e) {
            e
                ? BundleManager.setSpriteAtlas(
                    this.spriteData[e].path == "ui/uitps" ? BundleManager.bn.Res3 : BundleManager.bn.Res,
                    "/UI/" + this.spriteData[e].path,
                    this.spriteData[e].icon_name,
                    t,
                    !1
                )
                : (t.spriteFrame = null);
        };
        t.prototype.setTaBgSpriteView = function (t, e, o) {
            BundleManager.setSpriteAtlas2(
                BundleManager.bn.Res3,
                "/UI/ui/uitps",
                o ? "HUD_Frame_CommonBtn" : "HUD_Frame_CommonBtn_Disable",
                t.getComponent(cc.Sprite),
                !0
            );
            e.color = o ? cc.Color.GREEN : cc.Color.WHITE;
        };
        t.prototype.setInvateSpriteView = function (t, e) {
            BundleManager.setSpriteAtlas2(
                BundleManager.bn.Res3,
                "/UI/ui/uitps",
                e ? "envelope" : "HUD_Icon_Invite02",
                t,
                !0
            );
        };
        t.prototype.getSpritePath = function (t) {
            return t ? this.spriteData[t].icon_name : "";
        };
        t.prototype.setTypeIcon = function (t, e) {
            BundleManager.setSpriteAtlas(BundleManager.bn.Res3, "/UI/ui/uitps", this.typeIconPath[t], e, !1);
        };
        t.prototype.setSpritePath = function (t, e, o) {
            void 0 === o && (o = !1);
            BundleManager.setSpriteAtlas2(BundleManager.bn.Res3, "/UI/ui/uitps", e, t, o);
        };
        t.prototype.setQualityBgColor = function (t, e) {
            var o = this.getTypeIndexCofKey(t);
            o && (e.color = this.getTypeColor(o.bg_cfg));
        };
        t.prototype.setQualityName = function (t, e) {
            var o = this.getTypeIndexCofKey(t);
            e.string = "" + o.desc;
        };
        t.prototype.getQualityData = function (t) {
            return this.getTypeIndexCofKey(t);
        };
        t.prototype.setBtnCoin = function (t, e) {
            var o = "";
            switch (t) {
                case 1:
                    o = "Dynamic_Icon_Goods_Ads";
                    break;
                case 2:
                    o = "DynamicShop_Icon_package_key01_01";
                    break;
                case 3:
                    o = "DynamicShop_Icon_package_key02_01";
                    break;
                case 4:
                    o = "Dynamic_Icon_Goods_Gem";
            }
            this.setSpritePath(e, o, !0);
        };
        t.prototype.setBoxTop = function (t, e) {
            var o = "";
            switch (t) {
                case 1:
                    o = "Box_AD_01_Top_1";
                    break;
                case 2:
                    o = "Box_01_Top_1";
                    break;
                case 3:
                    o = "Box_02_Top_1";
            }
            this.setSpritePath(e, o, !0);
        };
        t.prototype.setBoxBottom = function (t, e) {
            var o = "";
            switch (t) {
                case 1:
                    o = "Box_AD_01_Bottom";
                    break;
                case 2:
                    o = "Box_01_Bottom";
                    break;
                case 3:
                    o = "Box_02_Bottom";
            }
            this.setSpritePath(e, o, !0);
        };
        t.prototype.setBoxOpen = function (t, e) {
            var o = "";
            switch (t) {
                case 1:
                    o = "Box_AD_01_Top_2";
                    break;
                case 2:
                    o = "Box_01_Top_2";
                    break;
                case 3:
                    o = "Box_02_Top_2";
            }
            this.setSpritePath(e, o, !0);
        };
        t.prototype.setQualityBgLineColor = function (t, e) {
            var o = this.getTypeIndexCofKey(t);
            o
                ? (e.color = this.getTypeColor(o.border_cfg))
                : console.log("SpriteView ----------------- typeDatatypeData");
        };
        t.prototype.getTypeIndexCofKey = function (t) {
            return this.qualityCfg[t];
        };
        return t;
    })())();
window.SpriteView = i;
o.default = i;
